<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<script>
function addorder()
{
	$('#addstorageform').modal('show');	
}
</script>
<title>销售项目列表</title>
<body class="withvernav">
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
  <div class="centercontent">
    <div class="pageheader notab">
      <h1 class="pagetitle">项目商品列表</h1>
      <span class="pagedesc"></span>
       <div class="menulist">
        <ul class="profile_summary">
          <li> <a href="javascript:void(0)" onClick="addorder()" class=""><span>增加项目商品</span></a></li>
        </ul>
      </div>
    </div>
    <!--pageheader-->
    
    <div id="contentwrapper" class="contentwrapper">
      <div id="basicform" class="subcontent">
          <!--搜索栏-->
           
    <form class="stdform stdform2" method="get" action="/order/sfexpress">
    <div style="height:26px;" class="tableoptions" style="padding:0px;">
      <div style="float:left"><strong>项目名称：{{$info.program_name}}</strong></div>
      <div  align="right" style="float:right;"> 计{{$total}}条记录
      </div>
    </div>
    </form>
    <!--搜索栏结束-->

             <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
          
            <thead>
              <tr>
                <th class="head1">ID.   </th>
                <th class="head1">商品编号  </th>
                <th class="head1">商品名称</th>
               <th class="head1">加入时间</th>
                <th class="head1">操作</th>
              </tr>
            </thead>
          
             {{foreach from=$goodslist item=detail key=key}}
                <tr>
                 <td>{{$detail.id}}</td>

                <td><a href="http://192.168.1.88:90/eshop/order.do?method=edit&orderid={{$detail.orderID}}" target="_blank">{{$detail.sku_code}}</a></td>
                <td>{{$detail.goods_name}}</td>
                <td>{{$detail.create_time}}</td>
                <td><a href="/sales/ajaxbutton?op=delGoods&id={{$detail.id}}">删除</a></td>
                </tr>
              {{/foreach}}
            {{if $goodslist eq null}}
            	<tr><td colspan="5" align="center" bgcolor="#fff">该项目下暂无商品信息！</td>
   	            </tr> 
            {{/if}}
          </table>
          
      <div class="page"> 计{{$total}}条记录</div>
         </div></div>
<!-- 模态框（Modal）添加商品属性 -->
<form action="/sales/addProgramProducts"  method="post" name="attributeform" id="attributeform" >
  <div class="modal fade" id="addstorageform" tabindex="-1" role="dialog" aria-labelledby="returnaddattributeform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="returnaddattributeform"> 添加项目商品</h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>所属项目：</td>
              <td align="left">{{$info.program_name}}</td>
            </tr>
            <tr>
              <td width="100">商品SKU号： </td>
              <td align="left"><textarea name="sku" id="sku" cols="10" rows="10"></textarea>
              <input type="hidden" name="program_id" value="{{$info.id}}" id="program_id"></td>
            </tr>
          
             <tr>
              <td>注意： </td>
              <td align="left">一行一个SKU商品编号</td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="ajaxPostAddProduct()"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
  <!-- /.modal -->
</form>
<script language="javascript">
	function ajaxPostAddProduct(){/*
		var skuval=$("#sku").val();
		var program_idval=$("#program_id").val();
		$.post("/sales/addProgramProducts",{sku:skuval,program_id:program_idval},function(ret){
			alert(ret);
			if(ret.state==1){
			}else{
				alert(ret.msg);
			}
		},'html');(*/
		$("#attributeform").submit();
	}
</script>
</body>
</html>